sum of subset problem algorithm